
function sendAjax()
{
    var username = $("#username").val();
    var password = $("#password").val();

    if (username == "") {
        alert("请输入用户名");
        return;
    }
    if (password == "") {
        alert("请输入密码");
        return;
    }
    $.ajax(
        {
            url:"/u/ajaxLogin",
            data:{"username":username,"password":password},
            type:"post",
            dataType:"json",
            success:function(data)
            {
                if(data.status==200){
                    location.href = "/backstage";
                }else{
                    alert(data.message);
                    // $("#erro").html(data.message);
                }
            },
            error: function() {
                alert("登录失败");
                // $("#erro").html("登录失败");
            }
        });
}

